package io.renren.modules.avanotes.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 本地笔记表
 *
 * @author zzr
 * @email 529742454@qq.com
 * @date 2022-01-24 22:50:09
 */
@Data
@TableName("local_markdown_notes")
public class LocalMarkdownNotesEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    public static String TABLE_NAME = "local_markdown_notes";

    public static String CN_ID = "id";
    public static String CN_FILE_NAME = "file_name";
    public static String CN_MD5 = "md5";
    public static String CN_ABSOLUTE_PATH = "absolute_path";
    public static String CN_RELATIVE_PATH = "relative_path";
    public static String CN_CONTENT = "content";
    public static String CN_STATUS = "status";
    public static String CN_UPDATE_TIME = "update_time";
    public static String CN_CREATE_TIME = "create_time";

    //region 状态区分

    public static final int STATUS_INIT = 0;
    public static final int STATUS_COMPLETE = 10;

    //endregion
    /**
     * 笔记id
     */
    @TableId
    private Long id;
    /**
     * 文件名称
     */
    private String fileName;
    /**
     * 内容的 MD5
     */
    private String md5;
    /**
     * 绝对路径
     */
    private String absolutePath;
    /**
     * 相对路径
     */
    private String relativePath;
    /**
     * 文本
     */
    private String content;
    /**
     * 状态（0-初始/等待分词处理；10-处理完成）
     * 0-分词处理>10
     * 10-数据更新>0
     */
    private Integer status;
    /**
     * 更新时间
     */
    private Date updateTime;
    /**
     * 创建时间
     */
    private Date createTime;

    public LocalMarkdownNotesEntity() {
    }

    public LocalMarkdownNotesEntity(String fileName, String absolutePath, String relativePath, String content, String md5) {
        this.fileName = fileName;
        this.absolutePath = absolutePath;
        this.relativePath = relativePath;
        this.content = content;
        this.md5 = md5;

        //默认属性
        this.createTime = this.updateTime = new Date();
        this.status = 0;
    }
}
